import { ColumnProps } from '~/library/components/ProTable/interface'
import { Member } from '~/src/api/interface/member'
import { genderType, memberStatus } from '~/src/utils/serviceDict'

export const memberInfoColumns: ColumnProps<Member.MemberInfo>[] = [
  { type: 'selection', width: 80 },
  { type: 'index', label: '序号', width: 60 },
  { sortable: true, prop: 'userName', label: '会员名称', width: 130, align: 'left', search: { el: 'input' } },
  { sortable: true, prop: 'nickName', label: '会员昵称', width: 140, align: 'left', search: { el: 'input' } },
  { sortable: true, prop: 'number', label: '会员卡号', align: 'left', width: 150 },
  { sortable: true, prop: 'categoryName', label: '会员分类', align: 'left', width: 110 },
  { sortable: true, prop: 'mobile', label: '手机号', width: 130, align: 'left', search: { el: 'input' } },
  {
    sortable: true,
    prop: 'sex',
    label: '性别',
    // 字典数据
    // enum: genderType,
    // 字典请求不带参数
    enum: genderType,
    align: 'left',
    width: 90,
    // 字典请求携带参数
    // enum: () => getUserGender({ id: 1 }),
    search: { el: 'select', props: { filterable: true } },
    fieldNames: { label: 'label', value: 'value' },
  },
  {
    sortable: true,
    prop: 'status',
    label: '状态',
    enum: memberStatus,
    width: 90,
    align: 'left',
    search: { el: 'select', props: { filterable: true } },
    fieldNames: { label: 'label', value: 'value' },
  },
  {
    sortable: true,
    prop: 'gradeName',
    label: '会员等级',
    align: 'left',
    width: 130,
  },
  { sortable: true, prop: 'balance', label: '储值余额', align: 'left', width: 150 },
  { sortable: true, prop: 'point', label: '积分', align: 'left', width: 100 },
  { sortable: true, prop: 'starDate', label: '启动日期', align: 'left', width: 170 },
  { sortable: true, prop: 'endDate', label: '失效日期', align: 'left', width: 170 },
  // { prop: 'operation', label: '操作', width: 220, fixed: 'right' },
]
